﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using MEFNavigation;
using Caliburn.Micro;

namespace NavTest2.ViewModels
{
    [ExportViewModel("About")]
    public class AboutPageViewModel : Screen
    {

        protected override void OnActivate()
        {
            MessageBox.Show("OnActivate");
            base.OnActivate();
        }

        protected override void OnInitialize()
        {
            MessageBox.Show("OnInitialize - should only show once.");
            base.OnInitialize();
        }

        protected override void OnDeactivate(bool close)
        {
            MessageBox.Show("OnDeactivate");
            base.OnDeactivate(close);
        }

        string name;

        public string Name
        {
            get { return name; }
            set
            {
                name = value;
                NotifyOfPropertyChange(() => Name);
                NotifyOfPropertyChange(() => CanSayHello);
            }
        }

        public bool CanSayHello
        {
            get { return !string.IsNullOrWhiteSpace(Name); }
        }

        public void SayHello()
        {
            MessageBox.Show(this.Name);
        }
    }
}
